from app.services.business.gaolu_diagnose.ind.abstract_ind import AbstractInd


class CG_LT_GL_GL04_Tie_V_1(AbstractInd):

    def get_name(self):
        return "CG_LT_GL_GL04_Tie_V_1"

    def get_data_source(self):
        return "mysql"

    def get_db(self):
        return "ironman"

    def get_sql(self, params):
        sql_Tie_V_1 = """      
        SELECT
        ROUND(AVG(CG_LT_GL_GL04_Tie_V),3) as CG_LT_GL_GL04_Tie_V_1
        FROM
        hanfan_new_predict
        WHERE DATE_TIME > DATE_SUB(CURTIME(), INTERVAL 4 hour)         

        """.format(**params)
        return sql_Tie_V_1
